//this array will hold numbers of all rows with parameters we need
		var rowsWithParams = []; 
		
		var gadgetName;     //write gadget name here so right instructions can be recognised
		var tableVersion;   //table version should be dynamically loaded from ianterface or input data
		
		//Sends a request to the server to load table reading instructions
		function requestInstructions()
		{
			var params = {};
			params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
			url = "http://rrrrrrr.googlecode.com/svn/trunk/Config/datadesc.conf";

			makeCachedRequest(url, receiveInstructions, params, 0); 
				//4th parameter cache refresh period in seconds: 0=no cache, default 3600. Use low numbers ONLY for debugging purposes
		}
		
		//callback for the "requestInstructions" function
		function receiveInstructions(obj)
		{
			parseInstructions(obj.text);
		}
		
		//parses instructions and reads the data for the current gadget
		//pass the number of table version so right set of rows is read
		function parseInstructions(receivedText)
		{			
		    rowsWithParams = null; 
			receivedText = receivedText.toString();
			
			var regexGadget = new RegExp(gadgetName+"\r\n*\\{[^\\}]*\\}","m");   //selects the data corresponding to the right gadget			
			var matchedGadget = regexGadget.exec(receivedText);

			if(matchedGadget==null)
			{
				window.alert("Gadget: "+gadgetName+" does not exist in config file. Check that the name is correct.");
				return;
			}
			
			matchedGadget = matchedGadget.toString();
			var regexTableVersion = new RegExp (tableVersion+":.*","m");     //selects the data corresponding to the right table
			var matchedTableVersion = regexTableVersion.exec(matchedGadget);				

			if(matchedTableVersion==null)
			{
				window.alert("Table version "+tableVersion+" does not exist in config file, please report error");
				return;
			}
			
			matchedTableVersion = matchedTableVersion.toString();
			var instructionString = matchedTableVersion.replace(/.:(.*)/,"$1");
			instructionString = instructionString.toString();

			rowsWithParams = instructionString.split(/;/)                    //stores row numbers into an array
			
			continueWork();                                                  //this function triggers the rest of the work to be done
																			 //declare it in your script

		}
		
		//use a specified cache refresh interval
		function makeCachedRequest(url, callback, params, refreshInterval)
		{
  			var ts = new Date().getTime();
  			var sep = "?";
  			if (refreshInterval && refreshInterval > 0) 
			{
  		  		ts = Math.floor(ts / (refreshInterval * 1000));
  			}
  			if (url.indexOf("?") > -1)
			{
    			sep = "&";
  			}
  			url = [ url, sep, "nocache=", ts ].join("");
  			gadgets.io.makeRequest(url, callback, params);
		}
		
		function readNameVersion()
		{
			gadgetName = document.getElementById("gadgetName").value;
			tableVersion = document.getElementById("tableVersion").value;
		}